package cn.com.lms.business.core.constant;

import lombok.Getter;

/**
 * 学习计划状态
 */
@Getter
public enum LearningStateEnum {

    NO_RELEASE("待发布", 0),
    IS_RELEASE("进行中", 1),
    FINISH("已完成", 2);

    private String value;
    private Integer code;

    LearningStateEnum(String value, Integer code) {
        this.value = value;
        this.code = code;
    }

    public static String getValueByCode(Integer code) {
        for (LearningStateEnum stateEnum : LearningStateEnum.values()) {
            if (stateEnum.getCode().equals(code)) {
                return stateEnum.getValue();
            }
        }
        return null;
    }

}
